1. Field of the Invention
The present invention relates to the Universal Serial Bus (USB) protocol. In particular, the invention relates to the control of versatile USB endpoints.
2. Description of the Related Art
Universal Serial Bus (USB) is a standard peripheral interface for attaching personal computers to a wide variety of devices: e.g., digital telephone lines, monitors, modems, mice, printers, scanners, game controllers, keyboards, and other peripherals. The USB thus replaces existing interfaces such as the RS-232C serial ports, parallel ports, PS/2 interfaces, and game/MIDI ports.
In accordance with USB, all attached devices connect to a personal computer through a single connector type using a tiered-star topology. A host personal computer includes a single USB controller. The host controller provides the interface between the USB network and the host personal computer. The host controller controls all accesses to USB resources and monitors the bus's topology. A USB hub provides USB attachment points for USB devices.
A USB function is a USB device that is able to transmit and receive information on the bus. A function may have one, or more, configurations, each of which defines the interfaces that make up the device. Each interface, in turn, is made up of one of more endpoints.
An endpoint is the ultimate source, or sink, of data. An endpoint pipe provides for the movement of data between USB and memory, and completes the path between the USB host and the function endpoint.
Each endpoint is an addressable entity on USB and is required to respond to IN and OUT tokens from the USB host (typically a PC). The IN tokens indicate that the host has requested to receive information from an endpoint, and OUT tokens indicate that the host is about to send information to an endpoint.
On detection of an IN token addressed to an endpoint, the endpoint is responsible for responding with a data packet. If the endpoint is currently stalled, a STALL handshake packet is sent. If the endpoint is enabled, but no data is present, a negative acknowledgment (NAK) handshake packet is sent.
Similarly, on detection of an OUT token addressed to an endpoint, the endpoint is responsible for receiving a data packet sent by the host and storing it in a buffer. If the endpoint pipe is currently stalled, at the end of the data transmission, a STALL handshake packet is sent. If the endpoint pipe is currently disabled, at the end of the data transmission, no handshake packet is sent. If the endpoint pipe is enabled, but no buffer is present in which to store the data, a NAK handshake packet is sent.
A disabled endpoint, or endpoints not currently mapped to an endpoint pipe do not respond to IN, OUT, or SETUP tokens.
A number of vendors have developed implementations of the USB standard. For example, Intel Corp. has released the 8x931Ax, 8x931Hx, 8x930Ax, and 8x930Hx devices.
However, these devices have a number of limitations. For example, the 8x931Ax is limited to three endpoint pairs of a transmit endpoint and a receive endpoint, each with predefined and dedicated data storage (dedicated FIFOs). The other Intel devices have similar limitations. Furthermore, each endpoint pair can operate under only a subset of the available USB transmission types. There is a need for a device having a greater number of endpoints whose types and data storage can be defined as necessary.
In addition, the 8x931Ax uses a large number of registers to store control information. There is a need for a device having fewer registers to reduce the cost per endpoint.